/*
 * File:   F03.h
 * Author: jcrada
 *
 * Created on 30 May 2011, 12:04 PM
 */

#ifndef ECB_CEC10_F03_H
#define	ECB_CEC10_F03_H

#include "ecb/benchmarks/cec10/CecProblem.h" 

#include "ecb/benchmarks/cec10/CecMath.h"
#include "ecb/operator/Shifted.h"
#include "ecb/function/Ackley.h"


namespace ecb{
    namespace cec10 {

        class F03 : public CecProblem {
        private:
            Function* ackley;
        public:

            F03(int dimensions)
            : CecProblem("F03", "Shifted Ackley's Function", dimensions,
            -32, 32, true, 0, new CecRandom(3l)) {
                std::vector<scalar> shift = CecMath::ShiftVector(dimensions, _properties->getMinimum(), _properties->getMaximum(), randomizer());
                ackley = new Shifted(shift, 0, new Ackley());
            }

            ~F03() {
                delete ackley;
            }

            scalar f(const std::vector<scalar>& x) {
                return ackley->f(x);
            }
        };
    }
}

#endif	/* ECB_CEC10_F03_H */

